// 引入工具类
import request from '@/utils/request.js' 
 
const login = {
	postLogin: data => {// 获取token
		return request({
			url: '/wx/login',
			method: 'POST',
			data: data,
			contentType:'application/x-www-form-urlencoded',
			isLoading: false ,//是否需要显示加载动画
			isLogin: false //是否需要登录 需要则带入token
		})
	},
	getUserInfo: data => {//获取用户信息
		return request({
			url:'/wx/getWxUser',
			method: 'GET',
			data: data,
			isLoading: true ,
			isLogin: true 
		})
	},
	postLoginCode: data => {// 获取token
		return request({
			url: '/wx/loginCode',
			method: 'GET',
			data: data,
			// contentType:'application/x-www-form-urlencoded',
			isLoading: false ,//是否需要显示加载动画
			isLogin: false //是否需要登录 需要则带入token
		})
	},
	loginPhone: data => {// 获取token
		return request({
			url: '/wx/loginPhone',
			method: 'POST',
			data: data,
			contentType:'application/x-www-form-urlencoded',
			isLoading: false ,//是否需要显示加载动画
			isLogin: false //是否需要登录 需要则带入token
		})
	},
	
	getPrivacyPolicy: data => {//隐私条款
		return request({
			url:'/wx/privacyPolicy',
			method: 'GET',
			data: data,
			isLoading: true ,
			isLogin: false 
		})
	},
	
	getUserAgreement: data => {//用户协议
		return request({
			url:'/wx/userAgreement',
			method: 'GET',
			data: data,
			isLoading: true ,
			isLogin: false 
		})
	},
	
}

export default login